package cn.dakaqi.entities;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/17.
 * 志愿者报名参加活动
 */
@Cacheable
@Entity
@Table(name = "U_ACTIVITY_APPLY")
public class ActivityApply extends IdEntity
{
    private Volunteer volunteer;    //志愿者
    private Activity activity;      //活动
    private Date createTime;        //报名日期
    private int status;             //审核状态
    private int role;               //本次活动中的身份
    private int delStatus;          //是否被删除
    private String refuseCase;      //拒绝理由
    public ActivityApply()
    {
    }

    public String getRefuseCase()
    {
        return refuseCase;
    }

    public void setRefuseCase(String refuseCase)
    {
        this.refuseCase = refuseCase;
    }

    public ActivityApply(Long id)
    {
        this.id = id;
    }
    @JsonIgnore
    public int getDelStatus()
    {
        return delStatus;
    }

    public void setDelStatus(int delStatus)
    {
        this.delStatus = delStatus;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name = "VOLUNTEER_ID")
    public Volunteer getVolunteer()
    {
        return volunteer;
    }

    public void setVolunteer(Volunteer volunteer)
    {
        this.volunteer = volunteer;
    }

    @JsonIgnore
    @ManyToOne
    @JoinColumn(name="ACTIVITY_ID")
    public Activity getActivity()
    {
        return activity;
    }

    public void setActivity(Activity activity)
    {
        this.activity = activity;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public int getRole()
    {
        return role;
    }

    public void setRole(int role)
    {
        this.role = role;
    }
}
